package com.garagesale.data;
// Generated May 3, 2011 8:59:20 PM by Hibernate Tools 3.2.1.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * ItemCategory generated by hbm2java
 */
@Entity
@Table(name = "item_category", catalog = "garage_sale", uniqueConstraints =
{
    @UniqueConstraint(columnNames = "name"),
    @UniqueConstraint(columnNames = "label_color")
})
public class ItemCategory implements java.io.Serializable
{

    private Integer itemCategoryID;
    private String name;
    private String labelColor;
    private String imageLocation;
    private Set<Item> items = new HashSet<Item>(0);

    public ItemCategory()
    {
    }

    public ItemCategory(String name, String labelColor, String imageLocation)
    {
        this.name = name;
        this.labelColor = labelColor;
        this.imageLocation = imageLocation;
    }

    public ItemCategory(Integer itemCategoryID, String name, String labelColor, String imageLocation)
    {
        this.itemCategoryID = itemCategoryID;
        this.name = name;
        this.labelColor = labelColor;
        this.imageLocation = imageLocation;
    }

    

    public ItemCategory(String name, String labelColor)
    {
        this.name = name;
        this.labelColor = labelColor;
    }

    public ItemCategory(String name, String labelColor, String imageLocation, Set<Item> items)
    {
        this.name = name;
        this.labelColor = labelColor;
        this.imageLocation = imageLocation;
        this.items = items;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "item_category_id", unique = true, nullable = false)
    public Integer getItemCategoryID()
    {
        return this.itemCategoryID;
    }

    public void setItemCategoryID(Integer itemCategoryId)
    {
        this.itemCategoryID = itemCategoryId;
    }

    @Column(name = "name", unique = true, nullable = false, length = 128)
    public String getName()
    {
        return this.name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    @Column(name = "label_color", unique = true, nullable = false, length = 128)
    public String getLabelColor()
    {
        return this.labelColor;
    }

    public void setLabelColor(String labelColor)
    {
        this.labelColor = labelColor;
    }

    @Column(name = "image_location", length = 512)
    public String getImageLocation()
    {
        return this.imageLocation;
    }

    public void setImageLocation(String imageLocation)
    {
        this.imageLocation = imageLocation;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "itemCategory")
    public Set<Item> getItems()
    {
        return this.items;
    }

    public void setItems(Set<Item> items)
    {
        this.items = items;
    }
}
